<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
    />
    <title>人脸认证</title>
    <style type="text/css">
      .btn {
        display: block;
        margin: 20px auto;
        padding: 5px;
        background-color: #007aff;
        border: 0;
        color: #ffffff;
        height: 40px;
        width: 200px;
      }

      .btn-red {
        background-color: #dd524d;
      }

      .btn-yellow {
        background-color: #f0ad4e;
      }

      .desc {
        padding: 10px;
        color: #999999;
      }

      .post-message-section {
        visibility: hidden;
      }
    </style>
  </head>
  <body>
    <div id="app"></div>
    <button type="button" class="btn btn-primary">点击返回</button>

    <!-- uni 的 SDK -->
    <script type="text/javascript" src="./wx.js"></script>
    <!-- 需要把 uni.webview.1.5.4.js 下载到自己的服务器 -->
    <script
      type="text/javascript"
      src="./hybrid_html_uni.webview.1.5.5.js"
    ></script>
    <script type="text/javascript">
      // 待触发 `UniAppJSBridgeReady` 事件后，即可调用 uni 的 API。
      document.addEventListener("UniAppJSBridgeReady", function () {
        document
          .querySelector(".btn")
          .addEventListener("click", function (evt) {
            uni.navigateBack(); //sdk中默认如果没有参数，则delta为1
          });
        // 向小程序发送数据
        uni.postMessage({
          data: {
            action: "faceRes",
          },
        });
      });
    </script>
  </body>
</html>
